package cn.edu.lingnan.servlet;

import cn.edu.lingnan.dao.StudentDaoMysqlImpl;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

public class HelloServlet extends HttpServlet{
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
//            throws ServletException, IOException {
//        String username = req.getParameter("username");
//        String password = req.getParameter("password");
//        StudentDaoMysqlImpl service = new StudentDaoMysqlImpl();
//        boolean flag = service.findStudentByNameAndPassword(username, password);
//        if (flag){
//            resp.sendRedirect("/main.html");
//        }else {
//            resp.sendRedirect("/error.html");
//
//        }
//
//    }
//
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
//            throws ServletException, IOException {
//        doGet(req,resp);
//    }
}
